<template>
    <div class="items"
        :style="style.items">
        <h6 class="title"
            :style="style.title" v-text="Lang.changeemail[lang][3]">
            专属注册链接
        </h6>
        <div class="fcb"
            :style="style.box">
            <div class="link bb"
                :style="style.txt">
                <span v-text="link">http://118.190.201.248:82/#/signup</span>
            </div>
            <button :style="style.btn"
                @click="e_copy"
                v-clipboard:copy="link" v-text="Lang.changeemail[lang][4]">复制链接分享</button>
        </div>
    </div>
</template>

<script>
import Lang from './lang.js'
import style from './style.jsx'
export default {
	data() {
		return {
			style,
			Lang,
		}
	},
	computed: {
		link() {
			// let base = 'http://localhost:2333/#/signup/'
			const base0 = window.location.href
			const base1 = base0.match(/^http\S+#\//)[0]
			const base2 = base1 + 'signup/'
			let id = this.$store.state.user.uid
			return base2 + id
		},
		lang() {
			return this.$store.state.setting.lang
		},
	},

	created() {},
	methods: {
		e_copy() {
			alert(this.Lang.changeemail[this.lang][5])
		},
	},
}
</script>

<style scoped>
.items {
	flex-grow: 1;
	width: 520px;
}
.link {
	flex-grow: 1;
	padding: 0 20px;
}
</style>